import queue

q = queue.LifoQueue()

q.put(5)

print ( q.get())

print ( q.empty())

for i in range(10):
    q.put(i)

while not q.empty():
    print(q.get(),end='   ')

q2 = queue.PriorityQueue()
q2.put((1,'P 1'))
q2.put((3,'P 3'))
q2.put((4,'P 4'))
q2.put((2,'P 2'))

for i2 in range(q2.qsize()):
    print (q2.get()[1])